package com.jpsl.core.reflection.property.f;

import com.jpsl.core.reflection.property.AccessException;
import com.jpsl.core.reflection.property.PropertyValueSetter;

import java.lang.reflect.Field;

public class ByFieldPropertyValueSetter extends ByFieldPropertyAccessor implements PropertyValueSetter {

    public ByFieldPropertyValueSetter(String property, Field field) {
        super(property, field);
    }

    @Override
    public void setValue(Object bean, Object value) throws AccessException {
        try {
            field.set(bean, value);
        } catch (IllegalAccessException e) {
            throw new AccessException(e);
        }
    }

}
